//
//  HomeViewController.m
//  大秀
//
//  Created by admin on 16/4/22.
//  Copyright © 2016年 yunzhen. All rights reserved.
//

#import "HomeViewController.h"
#import "LoginViewController.h"
#import "RegisterViewController.h"

@interface HomeViewController ()

@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self makeUI];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)makeUI{
    
    UIImageView *backGroundView = [[UIImageView alloc]initWithFrame:self.view.bounds];
    backGroundView.image = [UIImage imageNamed:@"登陆1"];
    UIImageView *backGroundImageView = [[UIImageView alloc]initWithFrame:CGRectMake((kScreenWidth - 192)/2, 100, 192, 97)];
    backGroundView.userInteractionEnabled = YES;
    backGroundImageView.image = [UIImage imageNamed:@"登陆1_03"];
    
    
    UIButton *loginBtn = [[UIButton alloc]initWithFrame:CGRectMake((kScreenWidth - 220)/2,300, 80, 40)];
    [loginBtn setTitle:@"注册" forState:UIControlStateNormal];
    loginBtn.backgroundColor = COLOR_RGBA(92, 167, 252, 1);
    loginBtn.layer.cornerRadius = 5.0f;
    [loginBtn.layer setBorderColor:[UIColor whiteColor].CGColor];
    [loginBtn.layer setBorderWidth:1];
    [loginBtn.layer setMasksToBounds:YES];
    [loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [loginBtn addTarget:self action:@selector(regin) forControlEvents:UIControlEventTouchUpInside];
    
    
    UIButton *reginBtn = [[UIButton alloc]initWithFrame:CGRectMake((kScreenWidth - 220)/2 + 140,300, 80, 40)];
    [reginBtn setTitle:@"登陆" forState:UIControlStateNormal];
    reginBtn.backgroundColor = [UIColor whiteColor];
    reginBtn.layer.cornerRadius = 5.0f;
    [reginBtn.layer setBorderColor:[UIColor whiteColor].CGColor];
    [reginBtn.layer setBorderWidth:1];
    [reginBtn.layer setMasksToBounds:YES];
    [reginBtn setTitleColor:[UIColor colorWithRed:92/255.0 green:167.0/255.0 blue:252/255.0 alpha:1] forState:UIControlStateNormal];
    [reginBtn addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
    
    
    [backGroundView addSubview:loginBtn];
    [backGroundView addSubview:backGroundImageView];
    [backGroundView addSubview:reginBtn];
    [self.view addSubview:backGroundView];
    
    
}


- (void)login{
    
    LoginViewController *loginVc = [[LoginViewController alloc]init];
    [self.navigationController pushViewController:loginVc animated:YES];
    
}

- (void)regin{
    
    RegisterViewController *reginsterVc = [[RegisterViewController alloc]init];
    [self.navigationController pushViewController:reginsterVc animated:YES];
    
    
}

- (void)viewWillAppear:(BOOL)animated{

    self.navigationController.navigationBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated{
 
    self.navigationController.navigationBar.hidden = NO;

}
@end
